<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/自定义axios.js"></script>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script> -->

</head>

<body>
    <script>
        axios.interceptors.request.use(config => {
            // Do something before request is sent
            return config;
        }, error => {
            // Do something with request error
            return Promise.reject(error);
        });

        axios.interceptors.response.use(response=>response.data, error=>{
            return Promise.reject(error);
        })

        axios({
            method:'get',
            url:'https://api.uixsj.cn/hitokoto/get?type=social'
        }).then(data=>{

        })
    </script>
</body>

</html>